import request from '@/utils/request'

/**
 * 活动条件分页查询接口

 */
export function page(name,place,org,begin,end,page,pageSize) {
  return request({
    url: '/admin/act/page?name='+name+'&place='+place+'&org='+org+'&begin='+begin+'&end='+end+'&page='+page+'&pageSize='+pageSize,
    method: 'get'
  })
}

export function getUnChoose(name,place,org,begin,end,page,pageSize) {
  return request({
    url: '/act/page2?name='+name+'&place='+place+'&org='+org+'&begin='+begin+'&end='+end+'&page='+page+'&pageSize='+pageSize,
    method: 'get'
  })
}

/**
 * 新增活动

 */
export function insert(activityForm) {
  return request({
    url: '/admin/act',
    method: 'post',
    data: activityForm
  })
}

/**
 * 根据id查询活动

 * @param {Object} id
 */
export function selectById(id) {
  return request({
    url: '/admin/act/dtl/'+id,
    method: 'get'
  })
}

/**
 * 更新活动

 * @param {Object} activityForm
 */
export function update(activityForm) {
  return request({
    url: '/admin/act/',
    method: 'put',
    data: activityForm
  })
}


/**
 * 选择活动

 */
export function choose(activity) {
  return request({
    url: '/act',
    method: 'post',
    data: activity
  })
}

/**
 * 取消选择活动

 */
export function unChoose(activity) {
  return request({
    url: '/act/cancel',
    method: 'delete',
    data: activity
  })
}


/**
 * 我的活动分页查询接口

 */
export function myChoose(page,pageSize) {
  return request({
    url: '/act?page='+page+'&pageSize='+pageSize,
    method: 'get'
  })
}


